<template>
	<view class="one">
		<!-- 搜索框 -->
		<view class="search-box">
			<view class="search-input">
				
				<input 
					type="text" 
					placeholder="输入需要搜索的内容" 
					placeholder-style="color: #CCCCCC;"
					v-model="searchText"
					@confirm="handleSearch"
				/>
				<image src="/static/搜索@3x.png" mode="aspectFit" class="search-icon"></image>
			</view>
		</view>
		
		<!-- 白色内容区域 -->
		<view class="nav">
			<view class="record-list">
				<view class="record-item" v-for="(item, index) in records" :key="index">
					<view class="record-title">{{item.title}}</view>
					<view class="record-info">
						<view class="info-item">
							<text class="info-label">下单用户：</text>
							<text>{{item.user}}</text>
						</view>
						<view class="info-item">
							<text class="info-label">实付金额：</text>
							<text class="amount">¥ {{item.amount}}</text>
						</view>
					</view>
					<view class="record-time">核销时间：{{item.time}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchText: '',
				records: [
					{
						title: '普通洗车、机油、工时',
						user: '张三',
						amount: '32.00',
						time: '2022-10-12 11:09'
					},
					{
						title: '普通洗车、机油、工时',
						user: '张三',
						amount: '32.00',
						time: '2022-10-12 11:09'
					},
					{
						title: '普通洗车、机油、工时',
						user: '张三',
						amount: '32.00',
						time: '2022-10-12 11:09'
					}
				]
			}
		},
		methods: {
			handleSearch(e) {
				console.log('搜索内容：', this.searchText);
				// 实现搜索逻辑
			}
		}
	}
</script>

<style>
page {
	background: #F7F7F7;
}

.one {
	padding-top: 20rpx;
	height: 250rpx;
	background-color: #2D80F9;
}

/* 搜索框样式 */
.search-box {
	padding: 20rpx 30rpx;
	display: flex;
	justify-content: center;  /* 水平居中 */
	align-items: center;      /* 垂直居中 */
}

.search-input {
	background-color: #FFFFFF;
	border-radius: 35rpx;
	width: 580rpx;
	height: 70rpx;
	display: flex;
	align-items: center;
	padding: 0 30rpx;
	margin: 0 auto;  /* 确保居中 */
}

.search-icon {
	width: 32rpx;
	height: 32rpx;
	margin-right: 10rpx;
}

.search-input input {
	flex: 1;
	height: 70rpx;
	font-size: 28rpx;
	padding-left: 10rpx;
}

/* 记录列表样式 */
.record-list {
	padding: 20rpx;
}

.record-item {
	background-color: #FFFFFF;
	border-radius: 20rpx;
	padding: 30rpx;
	margin-bottom: 20rpx;
}

.record-title {
	font-size: 32rpx;
	color: #333;
	padding-bottom: 20rpx;
	border-bottom: 2rpx solid #F5F5F5;
	margin-bottom: 20rpx;
}

.record-info {
	display: flex;
	flex-direction: column;
	font-size: 28rpx;
	color: #666;
	margin-bottom: 20rpx;
	padding-top: 0;
}

.info-item {
	margin-bottom: 20rpx;
}

.info-item:last-child {
	margin-bottom: 0;
}

.info-label {
	color: #666;
	display: inline-block;
	width: 140rpx;
}

.amount {
	color: #333;
	font-weight: 500;
}

.record-time {
	font-size: 24rpx;
	color: #999;
	padding-top: 0;
}
</style>
